package valve_test.DAO;

import valve_test.DAO.Impl.*;

/**
 * Created with IntelliJ IDEA.
 * User: Shinigami
 * Date: 11.03.14
 * Time: 22:23
 * To change this template use File | Settings | File Templates.
 */
public class Factory {
    private static ValvesDAO valvesDAO = null;
    private static IerarchyDAO ierarchyDAO = null;
    private static Factory instance = null;

    public static synchronized Factory getInstance(){
        if (instance == null){
            instance = new Factory();
        }
        return instance;
    }

    public ValvesDAO getValvesDAO(){
        if (valvesDAO == null){
            valvesDAO = new ValvesDAOImpl();
        }
        return valvesDAO;
    }

    public IerarchyDAO getIerarchyDAO(){
        if (ierarchyDAO == null){
            ierarchyDAO = new IerarchyDAOImpl();
        }
        return ierarchyDAO;
    }

}
